<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>H5-RTSP视频播放</title>
  <script src="flv.js"></script>
</head>
<body>
<div>
  <video id="player" width="480" controls autoplay></video>
</div>
<script>
  if (flvjs.isSupported()) {
    let video = document.getElementById("player");
    if (video) {
      this.player = flvjs.createPlayer({
        type: "flv",
        isLive: true,
        url: `ws://localhost:8888/rtsp?url=rtsp://127.0.0.1:8555/demo`
        // url: `ws://localhost:8888/rtsp?url=rtsp://admin:1234Qwer@172.29.2.114/h264/ch1/main/av_stream`
      });
      this.player.attachMediaElement(video);
      this.player.load();
      this.player.play();
    }
  }
</script>
</body>
</html>

